package com.amigo.online.provider.manager.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.amigo.online.common.base.controller.BaseController;
import com.amigo.online.common.core.response.Response;
import com.amigo.online.provider.manager.model.entity.VideoLookTbl;
import com.amigo.online.provider.manager.service.VideoLookTblService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

@RestController
@RequestMapping(value = "/videoLookTbl", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class VideoLookTblController extends BaseController {

    @Resource
    private VideoLookTblService videoLookTblService;

    @PostMapping(value = "/getVideoLookTblList")
    public ResponseEntity<Response> getVideoLookTblList(@RequestBody VideoLookTbl videoLookTbl) {

        JSONObject result = new JSONObject();
        // 分页语句
        Page<Object> page = PageHelper.startPage(videoLookTbl.getPageNo(), 10);
        List<VideoLookTbl> videoLookTblList = videoLookTblService.findVideoLookTblList(videoLookTbl);
        result.put("videoLookTblList", videoLookTblList);
        result.put("pagetotal", page.getTotal());
        return success(result);
    }

}
